<template>
  <div>
    <el-cascader-panel
      :options="list"
      @change="onChange"
      :border="false"
      :props="{ multiple: true }"
    ></el-cascader-panel>
  </div>
</template>
<script>
export default {
  props: ['list', 'value', 'limitCount'],
  data() {
    return {};
  },
  methods: {
    onChange(values) {
      if (this.limitCount && values && values.length > this.limitCount) {
        values = values.splice(values.length - this.limitCount);
      }
      this.$emit('update:value', values);
      this.$emit('onChange', values);
    }
  }
};
</script>
